# Copyright (c) 2020, 2021 by Robert Bosch GmbH, Apex.AI Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

#
# Generates all message definitions required by iceoryx_dds and packages 
# them into a single library.
#
cmake_minimum_required(VERSION 3.5)
project(idlpp-cxx-generator)

find_package(CycloneDDS CONFIG REQUIRED)
find_package(Idlpp-cxx CONFIG REQUIRED)
find_package(CycloneDDS-CXX CONFIG REQUIRED)

add_library(iceoryx_dds_messages)

idl_ddscxx_generate(mempool_messages "${MESSAGE_DEFINITION_DIR}/Mempool.idl")
target_link_libraries(iceoryx_dds_messages
    PUBLIC
    CycloneDDS-CXX::ddscxx
    mempool_messages
)

set_target_properties(iceoryx_dds_messages PROPERTIES
    CXX_STANDARD_REQUIRED ON
    CXX_STANDARD 14
    POSITION_INDEPENDENT_CODE ON
)
